<!--
 @description 经销商详情
 @fileName Detail.vue
 @author zengqiongying
 @created 2023/04/18 22:41:42
-->
<template>
  <div>
    <Cell title="经销商编码" default-value="--" readonly :modelValue="detail.code" :labelBlack="labelBlack" />
    <Cell title="经销商名称" default-value="--" readonly :modelValue="detail.name" :labelBlack="labelBlack" custom />

    <Cell title="客户经营业务类型" divider custom is-column default-value="--" readonly :labelBlack="labelBlack">
      <Tags :list="businessTypeName" />
    </Cell>
    <Cell
      title="经销商联系电话"
      default-value="--"
      readonly
      :modelValue="detail.contactPhone"
      :labelBlack="labelBlack"
    />
    <Cell
      title="是否有电商配送权限"
      default-value="--"
      readonly
      dict-type-code="BOOLEANS"
      :modelValue="detail.isElecBusiniess"
      :labelBlack="false"
    />
    <Cell title="客户经营总面积" default-value="--" readonly :modelValue="detail.operateArea" />
    <Cell title="所属办事处" default-value="--" readonly :modelValue="detail.agencyName" :labelBlack="labelBlack" />
    <Cell title="办事处负责人" default-value="--" readonly :modelValue="detail.personName" :labelBlack="labelBlack" />
  </div>
</template>

<script lang="ts">
  import { defineComponent, computed } from 'vue'
  import Cell from '@/components/Cell/index.vue'
  import Tags from '@/components/Tags/index.vue'
  export default defineComponent({
    name: 'DealerDetailBasic',
    components: { Cell, Tags },
    props: {
      detail: {
        type: Object,
        default: () => {}
      },
      labelBlack: {
        type: Boolean,
        default: true
      }
    },
    setup(props) {
      const businessTypeName = computed(() => {
        if ([null, undefined, ''].includes(props.detail.businessTypeName)) return []
        const typeNames = `${props.detail.businessTypeName || ''}`.split(',')
        return typeNames
      })
      return {
        businessTypeName
      }
    }
  })
</script>
<style lang="less" scoped></style>
